package com.example.springboot.service;

import com.example.springboot.entity.Instore;
import com.example.springboot.entity.Order;
import com.example.springboot.mapper.InstoreMapper;
import com.example.springboot.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService {
    @Autowired
    private OrderMapper orderMapper;

    public int save(Order order){
        if(order.getId()==null){
            if(order.getIsApprove()==null){
                order.setIsApprove("未审批");
            }
            return orderMapper.insert(order);
        }else{
            return orderMapper.update(order);
        }
    }
}
